import request from '@/config/axios'

// 费用类别 VO
export interface ExpenseCategoryVO {
  title: string // 名称
  remark: string // 备注
  sort: number // 排序
  status: number // 状态（0正常 1停用）
}

// 费用类别 API
export const ExpenseCategoryApi = {
  // 查询费用类别分页
  getExpenseCategoryPage: async (params: any) => {
    return await request.get({ url: `/office/expense-category/page`, params })
  },

  // 查询费用类别详情
  getExpenseCategory: async (id: number) => {
    return await request.get({ url: `/office/expense-category/get?id=` + id })
  },

  // 新增费用类别
  createExpenseCategory: async (data: ExpenseCategoryVO) => {
    return await request.post({ url: `/office/expense-category/create`, data })
  },

  // 修改费用类别
  updateExpenseCategory: async (data: ExpenseCategoryVO) => {
    return await request.put({ url: `/office/expense-category/update`, data })
  },

  // 删除费用类别
  deleteExpenseCategory: async (id: number) => {
    return await request.delete({ url: `/office/expense-category/delete?id=` + id })
  },

  // 导出费用类别 Excel
  exportExpenseCategory: async (params) => {
    return await request.download({ url: `/office/expense-category/export-excel`, params })
  },
}
